﻿using System.Windows.Input;
using Bookvar.UI.Commands;

namespace Bookvar.UI.ViewModel
{
    partial class MainPageViewModel
	{
        private class RedoCommand : CommandModel
        {

            public RedoCommand()
                : base(ApplicationCommands.Redo)
            {
            }

            protected internal override void OnExecute(object sender, ExecutedRoutedEventArgs e)
            {
                ActionService.Redo();
            }

            protected internal override void OnCanExecute(object sender, CanExecuteRoutedEventArgs e)
            {
                e.CanExecute = ActionService.HasActionToRedo && ActionService.CanRedo;
                e.Handled = true;
            }
        }
	}
}   
